﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KL.Store.Core.Domain
{
    public static class Convert2
    {
        public static int ToInt32(string value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return 0;
            }
            else
            {
                return Int32.Parse(value);
            }
        }

        public static short ToInt16(string value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return 0;
            }
            else
            {
                return Int16.Parse(value);
            }
        }

        public static string ToString(string value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return "";
            }
            else
            {
                return value.ToString();
            }
        }

    }
}
